<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Lazyload 路由组件的懒加载</title>
  </head>

  <body>
    <div id="app">
      <p>
        import React, { Component, lazy, Suspense } from "react";
        引入lazy,Suspense
      </p>
      <p>const Home = lazy(()=>{ import('./Home') }) 页面引入组件</p>
      <p>在注册路由的地方使用 Suspense 把路由包裹起来，和swtch差不多</p>
      <p>
          <Suspense fallback={<h1>loading...</h1>}>
            <Router></Router>
            <Router></Router>
          </Suspense>
      </p>
    </div>
    <script></script>
  </body>
</html>
